QT -= gui
QT += network
QT += core widgets

CONFIG += c++17
CONFIG -= app_bundle

# MSVC specific settings for Qt compatibility
msvc {
    QMAKE_CXXFLAGS += /Zc:__cplusplus
    QMAKE_CXXFLAGS += /permissive-
    # 生成调试信息用于符号化
    QMAKE_CXXFLAGS += /Zi
    QMAKE_LFLAGS += /DEBUG
}

TARGET = ZDMMService
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

# Main application sources
SOURCES += \
        main.cpp \
        mm_service.cpp \
        obs-context-wrapper.cpp \
        crash_handler.cpp \
        RecorderService/recorder-app.cpp \
        RecorderService/recorder-client.cpp \
        RecorderService/recorder-obs-context.cpp \
        RecorderService/recorder-outputs.cpp \
        RecorderService/recorder-audio-encoders.cpp \
        RecorderService/recorder-volume-controller.cpp \
        RecorderService/recorder-platform.cpp \
        RecorderService/recorder-logger.cpp \
        RecorderService/rtc-recorder.cpp \
        RTCService/src/rtcclient.cpp \
        RTCService/src/alirtceventhandler.cpp \
        RTCService/src/rtcaudioframeobserver.cpp

HEADERS += \
        mm_service.h \
        obs-context-wrapper.h \
        crash_handler.h \
        RecorderService/recorder-app.h \
        RecorderService/recorder-client.h \
        RecorderService/recorder-obs-context.h \
        RecorderService/recorder-outputs.hpp \
        RecorderService/recorder-audio-encoders.hpp \
        RecorderService/recorder-volume-controller.h \
        RecorderService/recorder-platform.h \
        RecorderService/recorder-logger.h \
        RecorderService/recorder-define.h \
        RecorderService/recorder-version.h \
        RecorderService/singlebase.h \
        RecorderService/rtc-recorder.h \
        RTCService/src/rtcclient.h \
        RTCService/src/alirtceventhandler.h \
        RTCService/src/rtcaudioframeobserver.h \
        RTCService/src/RTCDefine.h \
        RTCService/src/serialization.h \
        RTCService/src/utils.h \
        RTCService/src/enumserialization.h

# Include paths
INCLUDEPATH += RecorderService
INCLUDEPATH += RTCService/src
INCLUDEPATH += $$PWD/../obs-studio/libobs
INCLUDEPATH += $$PWD/../obs-build-dependencies/windows-deps-2023-01-06-x86/include
INCLUDEPATH += $$PWD/../DingRTC_Windows_SDK_3_6_11/api

# Library paths
LIBS += $$PWD/../obs-studio/build/libobs/Release/obs.lib
LIBS += $$PWD/../DingRTC_Windows_SDK_3_6_11/lib/x86/DingRTC.lib

# Windows specific libraries
win32 {
    # vcpkg breakpad配置
    VCPKG_ROOT = D:/zd/obsUpdate/crash/vcpkg
    VCPKG_INSTALLED = $${VCPKG_ROOT}/installed/x86-windows
    
    INCLUDEPATH += $${VCPKG_INSTALLED}/include
    LIBS += -L$${VCPKG_INSTALLED}/lib
    
    # 链接breakpad库
    LIBS += -llibbreakpad_client
    
    # Windows系统库
    LIBS += -lDbgHelp -lAdvapi32 -lOle32 -lws2_32
}

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
